package com.bristua.mall.order.controller;

import com.bristua.mall.common.bean.Result;
import com.bristua.mall.common.utils.HandleResultUtil;
import com.bristua.mall.order.biz.SubmitOrderBiz;
import com.bristua.mall.order.enums.OrderCode;
import com.bristua.mall.order.model.condition.submitOrder.SubmitOrder;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2019/3/24.
 */
@RestController
@Api(value="订单提交",tags={"订单提交"})
public class SubmitOrderController {

    @Autowired
    private SubmitOrderBiz submitOrderBiz;
    @ApiOperation(value="订单提交")
    @PostMapping(value="/api/order/submit")
    public Result submitOrder(@RequestBody SubmitOrder submitOrder){
        Result result = new Result();
        result.setCode(OrderCode.SEND_ORDER_SUCCESS.getCode());
        result.setMsg(OrderCode.SEND_ORDER_SUCCESS.getMsg());
        result.setData( submitOrderBiz.submitOrder(submitOrder));
        return result;
    }
}
